<%= search_form_for @search, url: spree.sales_total_admin_reports_path  do |s| %>
  <div class="form-group date-range-filter">
    <%= label_tag nil, Spree.t(:date_range) %>
    <div class="date-range-filter row">
      <div class="col-12 col-md-6 mb-3 mb-md-0">
        <div class="input-group datePickerFrom"
             data-wrap="true"
             data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>"
             data-max-date="<%= params[:q][:completed_at_lt] %>">
          <%= s.text_field :completed_at_gt,
                           class: 'form-control shadow-none',
                           placeholder: Spree.t(:starting_from),
                           value: datepicker_field_value(params[:q][:completed_at_gt]),
                           'data-input':'' %>

          <%= render partial: 'spree/admin/shared/cal_close' %>
        </div>
      </div>

      <div class="col-12 col-md-6 mt-3 mt-md-0">
        <div class="input-group datePickerTo"
             data-wrap="true"
             data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>"
             data-min-date="<%= params[:q][:completed_at_gt] %>">

          <%= s.text_field :completed_at_lt,
                           class: 'form-control shadow-none',
                           placeholder: Spree.t(:ending_at),
                           value: datepicker_field_value(params[:q][:completed_at_lt]),
                           'data-input':'' %>
          <%= render partial: 'spree/admin/shared/cal_close' %>
        </div>
      </div>
    </div>
  </div>

  <div class="form-actions">
    <%= button Spree.t(:search), 'search.svg' %>
  </div>
<% end %>
